package com.candy.service.impl;

import com.candy.dao.AccountCardMapper;
import com.candy.service.AccountService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("accountService2")
public class AccountService2Impl implements AccountService2 {
    @Autowired
    AccountCardMapper accountCardMapper;
    @Transactional
    @Override
    public void save(String outterName, String innerName, Integer money) {
        accountCardMapper.addMoney(innerName,money);
        System.out.println(2/0);
        accountCardMapper.subMoney(outterName,money);
    }
}
